package string;

public class StringDemo {
    public static void main(String[] args) {
        String a="asd";
        String b="asd";
        String c="asd";
        String d=new String("asd");
        System.out.println(a==b);
        System.out.println(a==c);
        System.out.println(a==d);

        String e="a";
        String f=e+"sd";
        System.out.println(a==f);
        String g="a"+"sd";
        System.out.println(a==g);


        String s1="123asd";
        String s2=new String("123asd");
        System.out.println(s1==s2);
        System.out.println(s1.equals(s2));
    }
}
